// Script assets have changed for v2.3.0 see
// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information
function PurchaseItem(_item, _amount, _cost){
	if(global.playerMoney >= _cost)
	{
		global.playerMoney -= _cost;
		global.playerHasAnyItems = true;
		global.playerItemUnlocked[_item] = true;
		global.playerAmmo[_item] += _amount;
		global.playerEquipped = _item;
		instance_destroy(activate);
		
		var _desc ="";
		switch(_item)
		{
			case ITEM.BOMB : _desc = "蹦蹦炸弹！"; break;
			case ITEM.BOW : _desc = "神明会指引你的箭。"; break;
			case ITEM.HOOK : _desc = "想象是发现的本质。"; break;
			default : _desc = "该物品没有描述"; break;
		}
		NewTextBox(_desc, 1);
	}
	else
	{
		NewTextBox("你太穷了！", 1);
	}
	
}